package com.whp.yky.yky.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.whp.yky.yky.entity.Borrow;
import com.whp.yky.yky.mapper.BorrowMapper;
import com.whp.yky.yky.service.BorrowService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author whp
 * @since 2021-04-21
 */
@Service
public class BorrowServiceImpl extends ServiceImpl<BorrowMapper, Borrow> implements BorrowService {


    @Autowired
    private BorrowMapper borrowMapper;

    @Override
    public IPage<Borrow> getShzBorrow(IPage<Borrow> page, Borrow borrow) {
        return page.setRecords(borrowMapper.getShzBorrow(page,borrow));
    }

    @Override
    public IPage<Borrow> getYshBorrow(IPage<Borrow> page, Borrow borrow) {
        return page.setRecords(borrowMapper.getYshBorrow(page,borrow));
    }

    @Override
    public List<Borrow> getPersonnalBorrowList(Integer userId) {
        return borrowMapper.getPersonnalBorrowList(userId);
    }
}
